/**
 * @type {Number}
 *
 * @properties={typeid:35,uuid:"B71C7DAB-C121-47A7-AA1C-C43D851AC728",variableType:4}
 */
var $historico = 0;

/**
 * @type {Number}
 *
 * @properties={typeid:35,uuid:"D91C122B-E346-4A75-B513-1F251A8DBB42",variableType:4}
 */
var $historico_listado_localidades = 1;

/**
 * @properties={typeid:24,uuid:"E1F7F6C7-6F4F-46A2-B491-CB5DFE430C2B"}
 */
function doEdit(){
	
	elements.btn_ir_pais.visible = false;
	elements.btn_borrar_pais.visible = true;
	
	elements.historicos.enabled = false;
	elements.btn_alta_historicos.enabled = false;
	elements.btn_menu_historicos.enabled = false;
	elements.tab_historicos.enabled = false;
	controller.focusField(elements.fld_s_descripcion.getName(),true);
}

/**
 * @properties={typeid:24,uuid:"05CFF207-A49E-4516-9E87-48DBA38394CB"}
 */
function hide_btn_reset_fields(){
	
	elements.btn_ir_pais.visible = true;
	elements.btn_borrar_pais.visible = false;
	
	elements.historicos.enabled = true;
	elements.btn_alta_historicos.enabled = true;
	elements.btn_menu_historicos.enabled = true;
	elements.tab_historicos.enabled = true;
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"17B02704-5533-4001-B516-9E6D4A286DD2"}
 */
function historico_opciones(event) {
	// TODO Auto-generated method stub
}

/**
 * Handle changed data.
 *
 * @param {Number} oldValue old value
 * @param {Number} newValue new value
 * @param {JSEvent} event the event that triggered the action
 *
 * @returns {Boolean}
 *
 * @private
 *
 * @properties={typeid:24,uuid:"CB6F33C6-93E4-4850-9B44-FF29FBD00385"}
 */
function onDataChangeHistorico(oldValue, newValue, event) {

	elements.tab_historicos.removeAllTabs();
	if  ($historico == $historico_listado_localidades){
//		elements.tab_historicos.addTab(forms.lst_adm_t900_usuarios_h,null,null,null,null,null,null, adm_t900_empresas_to_adm_t900_usuarios);
	}
	return true
}

/**
 * Callback method for when form is shown.
 * @author Roberto J. Blasco
 * @version 1.0
 * @param {Boolean} firstShow form is shown first time after load
 * @param {JSEvent} event the event that triggered the action
 * @private
 * @properties={typeid:24,uuid:"67B95559-E751-4F81-B85F-4A4B9B9C395D"}
 */
function onShow(firstShow, event) {

	if (foundset.getSelectedRecord().isNew()){
		elements.tab_historicos.visible = false;
	}else{
		
		var dataset = databaseManager.createEmptyDataSet(0,new Array('display_values','optional_real_values'));
		dataset.addRow(['LISTADO DE LOCALIDADES', $historico_listado_localidades]);
		elements.historicos.setValueListItems(dataset);
		
		elements.tab_historicos.visible = true;
		elements.tab_historicos.removeAllTabs();
		$historico = $historico_listado_localidades;
//		elements.tab_historicos.addTab(forms.lst_adm_t300_apli_emp__emp_h,null,null,null,null,null,null,adm_t900_aplicaciones_to_adm_t300_apli_emp);
	}
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"E830EB01-B023-41DA-90CF-30A484C027A4"}
 */
function historico_alta(event) {

	if ($historico == $historico_listado_localidades){
//		globals.ir_formulario(event, forms.frm_adm_t900_usuarios.controller.getName(), null,  globals.$MODO_ALTA,ds);
	}
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @private
 *
 * @properties={typeid:24,uuid:"0A51ABBF-83E6-4225-968A-02EFDA22D171"}
 */
function borrar_pais(event) {

	app_t200_paises_id = null;
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @private
 *
 * @properties={typeid:24,uuid:"CE7723B7-EC0F-4D27-9D52-997B89FE16A5"}
 */
function ir_pais(event) {

	globals.ir_formulario(event,forms.frm_app_t200_paises.controller.getName(),app_t200_provincias_to_app_t200_paises,globals.$MODO_LECTURA);
}
